package com.maixun.uitrasound.entity

import android.os.Parcelable
import com.google.gson.Gson
import kotlinx.android.parcel.Parcelize

/**
 * 作者：Lmoumou
 * 时间：2020/9/2 14:27
 */
@Parcelize
data class BannerBeen(
    var advertisementType: Int = 0, // 2
    var annexType: Int = 0, // 1
    var asDisplay: String = "", // 1
    var createTime: String = "", // 1563267484000
    var createUser: String = "", // 1136544299958153218
    var endTime: String = "", // 1564617600000
    var id: String = "", // 1151053370541813762
    var linkType: String = "0", // 2
    var remark: String = "", // 123
    var startTime: String = "", // 1563235200000
    var title: String = "", // 文章跳转哈
    var updateTime: String = "", // 1563267484000
    var updateUser: String = "", // 1136544299958153218
    var url: String = "", // https://ue-test-public.oss-cn-beijing.aliyuncs.com/uaed/1a4fedf3-e388-d1af-0611-b7a9c8018b75.jpg
    var target: String = "",
    var weight: Int = 0, // 222
    var messType: Int = 0
) : Parcelable {

    @Parcelize
    data class TargetBeen(
        var indexId: String = "",
        var atcType: Int = 0,
        var userId: String = "",
        var url: String = "",
        var paragraphType: Int = 0,
        var questionId: String = "",
        var pageId: String = "",
        var liveTime: String
    ) : Parcelable

    fun getTargetBeen(): TargetBeen? {
        var targetBeen: TargetBeen? = null
        try {
            targetBeen = Gson().fromJson<TargetBeen>(target, TargetBeen::class.java)
        } catch (e: Exception) {
            e.printStackTrace()
        }
        return targetBeen
    }
}


